import dayjs from 'dayjs'

// 引入中文
import 'dayjs/locale/zh-cn'
// 引入插件
import rTime from 'dayjs/plugin/relativeTime'
dayjs.locale('zh-cn')
dayjs.extend(rTime)

export const relativeTime = function (yourTime) {
  return dayjs().to(dayjs(yourTime))
}
